x11: Ignore old XFixesSelectionNotify events
authorJason Crain <jcrain@src.gnome.org>
Sat, 21 Jul 2018 09:17:57 +0000 (04:17 -0500)
committerJason Crain <jcrain@src.gnome.org>
Sat, 21 Jul 2018 20:22:04 +0000 (15:22 -0500)
commit77c3ef48cf5b9951435b0e37d74b9486fc194c95
tree9e59b26e3bd6457d263e655784609a8a1dd6dd26
parent7dabc2a42c41febd668fa8d2d1fc77850703ca09
x11: Ignore old XFixesSelectionNotify events

GtkEntryCompletion can rapidly release and claim ownership of the
primary selection. This generates multiple XFixesSelectionNotify events,
first stating that no one owns the selection, then another stating that
we own the selection. The notification that no one owns the selection
causes GtkEntryCompletion to deselect the text, breaking inline
autocompletion.

This fixes it by ignoring any XFixesSelectionNotify with a timestamp
earlier than our clipboard timestamp.

Fixes #14
gdk/x11/gdkclipboard-x11.c